function PopupBox2Gui(container, item, options) {
  this._container = container;
  this._item = item;
  this._options = options;
  this._unique = MiscUtils.unique();
  
  this._width = (options && options.width) ? options.width : '513';
  this._height = (options && options.height) ? options.height : '416';

  this._createElements();
  this._gui = PopupBox2Api.gui(this._unique);
}

PopupBox2Gui.prototype._createElements = function() {
  var table, tr, td, input;
  table = document.createElement('table');
  table.style.width = this._width + 'px';
  table.style.height = this._height + 'px';
  table.cellPadding = 0;
  table.cellSpacing = 0; 
  this._container.appendChild(table);
  
  tr=table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.height = '1px';
  td.style.width = '1px';

  td = tr.insertCell(-1);
  td.style.height = '1px';
  td.style.width = (this._width-6)+'px';
  td.style.backgroundColor = '#6a4348';
  
  td = tr.insertCell(-1);
  td.style.height = '1px';
  td.style.width = '5px';
  
  tr=table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.height = (this._height-7) + 'px';
  td.style.width = '1px';
  td.style.backgroundColor = '#6a4348';
  
  td = tr.insertCell(-1);
  td.style.height = (this._height-7) + 'px';
  td.style.width = (this._width-6)+'px';
  td.style.backgroundColor = '#fff';
    
  var itable = document.createElement('table');
  itable.style.width = (this._width-6)+'px';
  itable.style.height = (this._height-7) + 'px';
  itable.cellPadding = 0;
  itable.cellSpacing = 0; 
  itable.border = 0
  itable.style.backgroundColor = '#eeeeee';
  td.appendChild(itable);
  
  td = tr.insertCell(-1);
  td.style.height = (this._height-7) + 'px';
  td.style.width = '5px';
  td.style.backgroundImage='url(images/common/popupbox/rm.png)';
  td.style.backgroundRepeat = 'repeat-y';
  
  tr=table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.height = '6px';
  td.style.width = '1px';

  td = tr.insertCell(-1);
  td.style.height = '6px';
  td.style.width = (this._width-6) + 'px';
  td.style.backgroundImage='url(images/common/popupbox/bm.png)';
  td.style.backgroundRepeat = 'repeat-x';
  
  td = tr.insertCell(-1);
  td.style.height = '6px';
  td.style.width = '5px';
  td.style.backgroundImage='url(images/common/popupbox/br.png)';
  td.style.backgroundRepeat = 'no-repeat';


  itr = itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.height = '29px';
  itd.style.width = (this._width-6) + 'px';
  var div = document.createElement('div');
  div.id=this._unique + '_menu_div';
  itd.appendChild(div);
  var table1 = document.createElement('table');
  table1.style.width = (this._width-6) + 'px';
  table1.style.height = '29px';
  table1.cellPadding = 0;
  table1.cellSpacing = 0;
  table1.style.margin = '0 -1px 0 0';
  table1.style.backgroundImage='url(images/common/popupbox/tm.png)';
  table1.style.backgroundRepeat = 'repeat-x';
  div.appendChild(table1);
  
  tr1 = table1.insertRow(-1);
  td1 = tr1.insertCell(-1);
  td1.style.height = '29px';
  td1.style.width = '230px';
  td1.style.padding='0 0 0 20px';
  td1.style.color = '#fff';
  td1.style.whiteSpace = 'nowrap'
  td1.align = 'left';
  td1.id = this._unique + '_title_img';
  td1.style.fontWeight = 'bold';
  td1.style.fontSize = '15px';
  
  td1 = tr1.insertCell(-1);
  td1.style.height = '29px';
  td1.style.width = (this._width - 270) + 'px';
  td1.align = 'right';
  td1.style.padding='0 20px 0 0';
  td1.style.verticalAlign='top';
  var close = document.createElement('img');
  close.style.cursor = 'pointer';
  close.src = 'images/common/popupbox/close.png';
  close.id = this._unique + '_close_button';
  td1.appendChild(close);
  
  
  itr=itable.insertRow(-1);
  itd = itr.insertCell(-1);
  itd.style.width = (this._width-6) + 'px';
  itd.style.height = (this._height-7-29) + 'px';
  itd.align = 'center';
  itd.id = this._unique + '_panel_div';
};